<?php
/* @var $this BannerController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'Banners',
);

$this->menu=array(
	array('label'=>'Create Banner', 'url'=>array('create')),
	array('label'=>'Manage Banner', 'url'=>array('admin')),
);
?>
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
    <ul class="breadcrumb">
        <li><i class="ace-icon fa fa-home home-icon"></i><a href="<?=$this->createUrl('default/index')?>">首页</a></li>
        <li><a href="<?=$this->createUrl('banner/index')?>">Banner类型</a></li>
        <li class="active"><a href="<?=$this->createUrl('banner/banners',array('id'=>$list[0]->id))?>">Banner列表 (<?php echo $list[0]->tips;?>)</a></li>
    </ul><!-- /.breadcrumb -->
    <div class="nav-search" id="nav-search">
        <form class="form-search">
            <span class="input-icon">
                <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
                <i class="ace-icon fa fa-search nav-search-icon"></i>
            </span>
        </form>
    </div><!-- /.nav-search -->
</div><!-- /.breadcrumbs -->
<div class="page-content">
    <div class="page-header">
        <h1>Banners列表
            <small><i class="ace-icon fa fa-angle-double-right"></i> Banners List</small>
            <small>
                <a href="<?=$this->createUrl('banner/bannersCreate',array('id'=>$id))?>" class="btn btn-xs"><i class="fa fa-plus"></i> 创建</a>
                <a href="<?=$this->createUrl('banner/bannersDelete',array('id'=>$id))?>" class="btn btn-xs" title="删除" data-pjax="0" data-confirm="真的要删除吗？"><i class="fa fa-trash-o"></i> 删除</a>
            </small>
        </h1>

    </div><!-- /.page-header -->
    <div class="row">
        <div class="col-xs-12">

            <!-- PAGE CONTENT BEGINS -->
            <div class="row">
                <div class="col-xs-12">
                    <table id="simple-table" class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="center" width="20"><label class="pos-rel"><input type="checkbox" class="ace" name="selection_all" id="selection_all" /><span class="lbl"></span></label></th>
                            <th width="">图片</th>
                            <th width="">链接</th>
                            <th width="">描述</th>
                            <th width="">排序</th>
                            <th width="">状态</th>
                            <th width="105">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $key=>$data){
                            if(is_array(json_decode($data->value))){
                                foreach (json_decode($data->value) as $value){?>
                            <tr>
                                <td class="center"><label class="pos-rel"><input type="checkbox" class="ace" name="selection[]" value="<?=$value->sign?>"/><span class="lbl"></span></label></td>
                                <td><?php if($value->img){?><img src="<?php echo CHtml::encode($value->img); ?>" style="max-width:50px;max-height:40px;"><?php }?></td>
                                <td><?php echo CHtml::encode($value->link); ?></td>
                                <td><?php echo CHtml::encode($value->desc); ?></td>
                                <td><?php echo CHtml::encode($value->sort); ?></td>
                                <td><?=Constants::getYesNoItems($value->status); ?></td>
                                <td>
                                    <div class="hidden-sm hidden-xs btn-group">
                                        <a href="<?=$this->createUrl('bannersView',array('id'=>$data->id,'sign'=>$value->sign))?>" title="查看" class="btn btn-xs btn-success"><i class="ace-icon fa fa-eye bigger-120"></i></a>
                                        <a href="<?=$this->createUrl('bannersUpdate',array('id'=>$data->id,'sign'=>$value->sign))?>" title="编辑" class="btn btn-xs btn-info"><i class="ace-icon fa fa-pencil bigger-120"></i></a>
                                        <a href="<?=$this->createUrl('bannersDelete',array('id'=>$data->id,'sign'=>$value->sign))?>" title="删除" class="btn btn-xs btn-danger"><i class="ace-icon fa fa-trash-o bigger-120"></i></a>
                                    </div>
                                </td>
                            </tr>
                        <?php }
                            }
                        }?>
                        </tbody>
                    </table>
                    <div class="pagination-xs">

                    </div>
                </div><!-- /.span -->
            </div><!-- /.row -->
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.col -->
    </div><!-- /.row -->
</div><!-- /.page-content -->
